package com.banyuan.lesson.输入输出流;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/*
* 字符输入流 Reader；
* 一个字符一个字符的读；
* */
public class TestFileReader {
    public static void main(String[] args) {
        try(FileReader fr = new FileReader("aaa,txt")){
            char[] cbuf = new char[8];
            StringBuilder s = new StringBuilder();
            int len;
            while((len = fr.read(cbuf)) != -1){
                s.append(String.valueOf(cbuf,0,len));
            }
            System.out.println(s);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
